package com.itlong.cloud.project.property;

import com.itlong.cloud.POJO.DTO.property.PropertyParkingGetListDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyParkingGetOneDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyParkingSaveDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyParkingUpdateDTO;
import com.itlong.cloud.POJO.VO.property.PropertyParkingGetVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *      物业管理-车位管理暴露接口
 * </desc>
 *
 * @createDate 2018/08/17
 */
@FeignClient(name = "project-service")
public interface IPropertyParkingServiceClient {

    /**
     * <desc>
     *      添加车位信息
     * </desc>
     *
     * @param propertyParkingSaveDTO 添加车位信息数据DTO
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2018/08/17
     */
    @PostMapping(path = "property/parking/saveParking")
    Integer saveParking(@RequestBody PropertyParkingSaveDTO propertyParkingSaveDTO) throws Exception;

    /**
     * <desc>
     *      列表查询车位信息
     * </desc>
     *
     * @param propertyParkingGetListDTO 列表查询车位信息数据DTO
     * @return 分页结果
     * @author wangzhi
     * @createDate 2018/08/17
     */
    @PostMapping(path = "property/parking/getParkingsByPage")
    Page<PropertyParkingGetVO> getParkingsByPage(@RequestBody PropertyParkingGetListDTO propertyParkingGetListDTO) throws Exception;

    /**
     * <desc>
     *      获取单个车位信息
     * </desc>
     *
     * @param propertyParkingGetOneDTO 查询参数
     * @return 单个车位信息
     * @author wangzhi
     * @createDate 2018/08/17
     */
    @PostMapping(path = "property/parking/getOneParking")
    PropertyParkingGetVO getOneParking(@RequestBody PropertyParkingGetOneDTO propertyParkingGetOneDTO) throws Exception;

    /**
     * <desc>
     *      修改车位信息
     * </desc>
     *
     * @param propertyParkingUpdateDTO 修改参数
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2018/08/17
     */
    @PostMapping(path = "property/parking/updateParking")
    Integer updateParking(@RequestBody PropertyParkingUpdateDTO propertyParkingUpdateDTO) throws Exception;

    /**
     * <desc>
     *      批量删除车位信息
     * </desc>
     *
     * @param parkingIds 车位id，多个用英文","相连
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2018/08/17
     */
    @PostMapping(path = "property/parking/deleteParkings")
    Integer deleteParkings(@RequestParam("parkingIds") String parkingIds) throws Exception;

    /**
     * <desc>
     *      查询所有车位信息
     * </desc>
     *
     * @param propertyParkingGetListDTO 查询参数
     * @return 结果集
     * @author wangzhi
     * @createDate 2018/08/17
     */
    @PostMapping(path = "property/parking/getAllParkings")
    List<PropertyParkingGetVO> getAllParkings(@RequestBody PropertyParkingGetListDTO propertyParkingGetListDTO) throws Exception;

    /**
     * <desc>
     *      批量导入车位信息
     * </desc>
     *
     * @param projectId 项目id
     * @param propertyParkingSaveDTOList 车位信息集
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2018/08/17
     */
    @PostMapping(path = "property/parking/importParkings")
    Integer batchSaveParkings(@RequestParam("projectId") String projectId, @RequestBody List<PropertyParkingSaveDTO> propertyParkingSaveDTOList) throws Exception;
}
